package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;

/**
 * Created by lyh on 2017-04-27.
 */
@Entity
@Table(name = "m_gi", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class MGiEntity extends IAcross
{
	public MGiEntity()
	{
		super();
	}

	public MGiEntity(IAcross ia)
	{
		super(ia);
	}

    private int giId;
    private String giCode;
    private int level;
    private String type;
    private int prevId;
    private String prevCode;
    private int prevLevel;
    private String prevType;

    @Id
    @Column(name = "gi_id")
    @GeneratedValue
    public int getGiId() {
        return giId;
    }

    public void setGiId(int giId) {
        this.giId = giId;
    }

    @Basic
    @Column(name = "gi_code")
    public String getGiCode() {
        return giCode;
    }

    public void setGiCode(String giCode) {
        this.giCode = giCode;
    }

    @Basic
    @Column(name = "level")
    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "prev_id")
    public int getPrevId() {
        return prevId;
    }

    public void setPrevId(int prevId) {
        this.prevId = prevId;
    }

    @Basic
    @Column(name = "prev_code")
    public String getPrevCode() {
        return prevCode;
    }

    public void setPrevCode(String prevCode) {
        this.prevCode = prevCode;
    }

    @Basic
    @Column(name = "prev_level")
    public int getPrevLevel() {
        return prevLevel;
    }

    public void setPrevLevel(int prevLevel) {
        this.prevLevel = prevLevel;
    }

    @Basic
    @Column(name = "prev_type")
    public String getPrevType() {
        return prevType;
    }

    public void setPrevType(String prevType) {
        this.prevType = prevType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MGiEntity mGiEntity = (MGiEntity) o;

        if (giId != mGiEntity.giId) return false;
        if (level != mGiEntity.level) return false;
        if (prevId != mGiEntity.prevId) return false;
        if (prevLevel != mGiEntity.prevLevel) return false;
        if (giCode != null ? !giCode.equals(mGiEntity.giCode) : mGiEntity.giCode != null) return false;
        if (prevCode != null ? !prevCode.equals(mGiEntity.prevCode) : mGiEntity.prevCode != null) return false;
        if (prevType != null ? !prevType.equals(mGiEntity.prevType) : mGiEntity.prevType != null) return false;
        if (type != null ? !type.equals(mGiEntity.type) : mGiEntity.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = giId;
        result = 31 * result + (giCode != null ? giCode.hashCode() : 0);
        result = 31 * result + level;
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + prevId;
        result = 31 * result + (prevCode != null ? prevCode.hashCode() : 0);
        result = 31 * result + prevLevel;
        result = 31 * result + (prevType != null ? prevType.hashCode() : 0);
        return result;
    }
}
